package com.unionPay.net;

import java.io.BufferedReader;
import java.io.DataOutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;

import android.util.Log;


public class HttpResponse {

	public String connectWebServer(URL url) throws IOException{
		StringBuffer  resultData = new StringBuffer();
		if (url != null)
		{
			try
			{
				HttpURLConnection urlConn = (HttpURLConnection) url.openConnection();
				InputStreamReader in = new InputStreamReader(urlConn.getInputStream(),"UTF-8");
				BufferedReader buffer = new BufferedReader(in);
				String inputLine = null;
				while (((inputLine = buffer.readLine()) != null))
				{
					resultData.append(inputLine);
				}		  
				in.close();
				urlConn.disconnect();
			}
			catch (IOException e)
			{
			}
		}
		else
		{
		}
		System.out.println("result==="+resultData.toString());
		return resultData.toString();

	}

}
